/**
 * 
 */
package sourceFiles;

import java.util.LinkedList;
import java.util.Map;

import Exceptions.InvalidChildID;
import Exceptions.InvalidGuardianID;
import Exceptions.InvalidRideId;
import Exceptions.TicketDoesntExist;
import Exceptions.CentralComputerExceptions.ChildIDDoesntExist;
import Exceptions.CentralComputerExceptions.ErrorInGuardianPassword;
import Exceptions.CentralComputerExceptions.GuardianIDDoesntExist;
import Exceptions.CentralComputerExceptions.InvalidPassword;
import Exceptions.CentralComputerExceptions.NoChildrenForGuardian;
import Exceptions.CentralComputerExceptions.RideIDDoesntExist;

/**
* A class that responsible for all application functionality in E-Park. 
* The user that uses the application, can login and purchase rides tickets his children.
* The user can cancel previous acquisitions.
* The user can supervise his children by display in the application the children positions
* in E-Park rides.
* @author LASO-Team
* 
*/
public interface IApplication {


	/**
	 * The method logs in the user to the application.
	 * @param userID
	 * 			the guardian's ID.
	 * @param userPassword
	 * 			the password of the guardian.
	 * @throws InvalidPassword
	 * 			if the password is invalid.
	 * @throws GuardianIDDoesntExist
	 * 			if the guardian does not exist in E-Park system.
	 * @throws ErrorInGuardianPassword
	 * 			if the password is incorrect.
	 * @throws InvalidGuardianID
	 * 			if the guardian's ID is invalid.
	 */
	public void login(Integer userID, String userPassword)
			throws InvalidPassword, GuardianIDDoesntExist,
			ErrorInGuardianPassword, InvalidGuardianID;

	/**
	 * The method logs out the user from the application. 
	 */
	public void logout();


	/**
	 * The methods displays the guardian's children position in E-Park's rides.
	 * @param guardianID
	 * 			the guardain's ID.
	 * @return
	 * 			a Map collection: the key is the child's ID, and the value is the ride's ID.
	 * @throws GuardianIDDoesntExist
	 * 			if the guardian does not exist in the E-Park system.
	 * @throws NoChildrenForGuardian
	 * 			if there is no children for guardian.
	 * @throws InvalidGuardianID
	 * 			if the guardian's ID is invalid.
	 */
	public Map<Integer, Integer> displayChildrenPosition(Integer guardianID)
			throws GuardianIDDoesntExist, NoChildrenForGuardian, InvalidGuardianID;

	/**
	 * The method displays the child's E-Ticket.
	 * @param childID
	 * 			the child's ID.
	 * @return
	 * 			the E-Ticket of the child by his ID.
	 * @throws ChildIDDoesntExist
	 * 			if the child does not exist in the E-Park system.
	 * @throws InvalidChildID
	 * 			if the child's ID is invalid.
	 */
	public ETicket displayChildETicket(Integer childID)
			throws ChildIDDoesntExist, InvalidChildID;


	/**
	 * The method gets the rides catalog (with price parameter).
	 * @return the ridesCatalog
	 */
	public LinkedList<RideEntry> displayRidesCatalog();


	/**
	 * The method buying new chosen ride ticket to chosen child's E-Ticket.
	 * @param rideID
	 * 			the ride's ID.
	 * @param guardianID
	 * 			the guardian's ID.
	 * @param childID
	 * 			the child's ID.
	 * @throws InvalidRideId
	 * 			if the ride's ID is invalid.
	 * @throws ChildIDDoesntExist
	 * 			if the child does not exist in the E-Park system.
	 * @throws RideIDDoesntExist
	 * 			if the ride does not exist in the E-Park system.
	 * @throws GuardianIDDoesntExist
	 * 			if the guardian does not exist in the E-Park system.
	 * @throws InvalidChildID
	 * 			if the child's ID is invalid.
	 * @throws InvalidGuardianID
	 * 			if the guardian's ID is invalid.
	 */
	public void buyTicket(Integer rideID, Integer guardianID, Integer childID)
			throws InvalidRideId, ChildIDDoesntExist, RideIDDoesntExist,
			GuardianIDDoesntExist, InvalidChildID, InvalidGuardianID;

	/**
	 * The method cancels acquisition of chosen ride's ticket from the chosen child's E-Ticket.
	 * @param rideID
	 * 			the ride's ID.
	 * @param guardianID
	 * 			the guardain's ID.
	 * @param childID
	 * 			the child's ID.
	 * @throws InvalidRideId
	 * 			if the ride's ID is invalid.
	 * @throws ChildIDDoesntExist
	 * 			if the child does not exist in the E-Park system.
	 * @throws RideIDDoesntExist
	 * 			if the ride does not exist in the E-Park system.
	 * @throws TicketDoesntExist
	 * 			if the ticket does not exist.
	 * @throws GuardianIDDoesntExist
	 * 			if the guardian does not exist in the E-Park system.
	 * @throws InvalidGuardianID
	 * 			if the guardian's ID is invalid.
	 * @throws InvalidChildID	
	 * 			if the child's ID is invalid.
	 */
	public void cancelTicket(Integer rideID, Integer guardianID, Integer childID)
			throws InvalidRideId, ChildIDDoesntExist, RideIDDoesntExist,
			TicketDoesntExist, GuardianIDDoesntExist, InvalidGuardianID,
			InvalidChildID;
	
	
	/**
	 * guardian's ID getter
	 * @return the guardian's ID
	 */
	public Integer getGuardianID(); 

	/**
	 * guardian's ID setter
	 * @param guardianID 
	 * 			the guardian's ID to set
	 * 			
	 */
	public void setGuardianID(Integer guardianID);

	/**
	 * current child's ID getter
	 * @return the current child's ID
	 */
	public Integer getCurrentChildID();

	/**
	 * current child's ID setter
	 * @param currentChildID
	 * 			the current child's ID to set
	 */
	public void setCurrentChildID(Integer currentChildID);

	/**
	 * central computer getter
	 * @return the central computer component
	 */
	public ICentralComputer getCentralComputer();

	/**
	 * central computer setter
	 * @param centralComputer
	 * 			the central computer component to set
	 */
	public void setCentralComputer(ICentralComputer centralComputer);
	
	
//	/**
//	 * 
//	 */
	// public void applicationCycle();

}
